package tools

type SearchTableDataParam struct {
	PageNum       int    `json:"pageNum"`
	PageSize      int    `json:"pageSize"`
	Other         any    `json:"other"`
	OrderByColumn string `json:"orderByColumn,omitempty"`
	IsAsc         string `json:"isAsc,omitempty"`
	Params        Params `json:"params"`
}

type Params struct {
	BeginTime string `json:"beginTime"`
	EndTime   string `json:"endTime"`
}

type TableDataInfo struct {
	Total  int64 `json:"total"`
	Rows   any   `json:"rows"`
	IsNext bool  `json:"isNext"`
}

func Success(rows any, total int64) TableDataInfo {
	return TableDataInfo{
		Total: total,
		Rows:  rows,
	}
}
func Fail() TableDataInfo {
	return TableDataInfo{
		Total:  0,
		Rows:   nil,
		IsNext: false,
	}
}
